#!/usr/bin/env python

fd = open("colourdb.py", "w")
fd.write("colourdb = {}\n")
for line in (t.strip() for t in open('/usr/X11/share/X11/rgb.txt')):
	r, g, b, name = line.split(None, 3)
	r, g, b = map(lambda x : int(x)/255., (r, g, b))
	fd.write("colourdb[%s] = (%f, %f, %f)\n" % (repr(name), r, g, b))
fd.close()

